/**
 *
 */
package com.neiquan.secondhand.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.neiquan.secondhand.po.Goods;
import com.neiquan.secondhand.service.GoodService;

/**
 *	商品Controller
 * @author chenjunnan
 * @date 2016-6-12 下午01:33:05
 * @descript 商品Controller
 */
@Controller
@RequestMapping("/api/goods/")
public class GoodsController{
	@Autowired
	private GoodService goodsService;
	
	/**
	 * 发布商品
	 * @return
     */
	@RequestMapping(value="saveGoods.do", method= RequestMethod.POST)
	public String saveGoods(@ModelAttribute("goods") Goods goods ,Model model) {
		goods.setUserid("25544555");
		String resp=goodsService.saveGoods(goods);
		if(resp=="success"){ 
			return "personal";
		}else{
			return "error";
		}
		
		

	}
}

